/*package com.yksj.healthtalk.ui.interestwall;


import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ToggleButton;

import com.yksj.healthtalk.R;
import com.yksj.healthtalk.comm.LodingFragmentDialog;
import com.yksj.healthtalk.entity.TagEntity;
import com.yksj.healthtalk.entity.UploadImageEntity;
import com.yksj.healthtalk.net.http.AsyncHttpResponseHandler;
import com.yksj.healthtalk.net.http.HttpRestClient;
import com.yksj.healthtalk.net.http.ObjectHttpResponseHandler;
import com.yksj.healthtalk.net.socket.SmartFoxClient;
import com.yksj.healthtalk.utils.ToastUtil;

*//**
 * 兴趣墙图片上传成功后可选择进入该界面设置修改沙龙信息
 * @author Administrator
 *
 *//*
public class InterestReleaseTopic extends BaseFragmentActivity implements OnClickListener{

	public static final String TAG = "InterestReleaseTopic";
	public static final int TOPIC_TAG = 0x0000005;
	*//**
	 * 上传的图片的数据
	 *//*
	private UploadImageEntity entity;
	*//**
	 * 沙龙名称
	 *//*
	private EditText groupName;
	*//**
	 * 沙龙描述
	 *//*
	private EditText groupDesc;
	*//**
	 * 沙龙标签
	 *//*
	private TextView tagDesc;
	private ToggleButton releaseSystemMessage;
	private List<TagEntity> tags;
	
	private FragmentManager manager;
	TextView numTextView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.interest_release_topic);
		getIntentData();
		initData();
		initView();
	}
	
	*//**
	 * 获取传递的数据
	 *//*
	public void getIntentData() {
		Bundle bundle = getIntent().getExtras();
		entity = bundle.getParcelable("data");
		tags = entity.getInfos();
	}
	
	public void initView() {
		initTitle();
		View tagChoose = findViewById(R.id.interest_tag_choose);
		groupName = (EditText) findViewById(R.id.title_input);//沙龙名称
		groupDesc = (EditText) findViewById(R.id.info_desc);//沙龙描述
		tagDesc = (TextView) findViewById(R.id.interest_tag_content);
		releaseSystemMessage = (ToggleButton) findViewById(R.id.message_setting_toggleBtn);
		tagChoose.setOnClickListener(this);
		groupName.setText(entity.getPicname());
		groupDesc.setText(entity.getPicdesc());
		tagDesc.setText(initTagText());
		numTextView = (TextView)findViewById(R.id.number_txt);
		groupDesc.addTextChangedListener(new TextWatcher() {
			@Override
			public void onTextChanged(CharSequence s, int start, int before, int count) {
			}
			@Override
			public void beforeTextChanged(CharSequence s, int start, int count,
					int after) {
				
			}
			@Override
			public void afterTextChanged(Editable s) {
				numTextView.setText(s.length()+"/500");
			}
		});
	}

	public void initData(){
		manager = getSupportFragmentManager();
	}

	private void initTitle() {
		Button backBtn = (Button) findViewById(R.id.title_back);
		backBtn.setOnClickListener(this);
		Button rightBtn = (Button) findViewById(R.id.title_right);
		rightBtn.setBackgroundResource(R.drawable.title_ok);
		rightBtn.setOnClickListener(this);
	}
	
	*//**
	 * 初始化标签文本
	 * @return
	 *//*
	public String initTagText() {
		String result = "";
		for(int i=0;i<tags.size();i++) {
			result +=tags.get(i).getName()+",";
		}
		return result.substring(0, result.lastIndexOf(","));
	}
	
	*//**
	 * 初始化标签信息，以逗号分隔开
	 * @return
	 *//*
	public String initTagInfoLayId() {
		String result = "";
		for(int i=0;i<tags.size();i++) {
			result +=tags.get(i).getId()+",";
		}
		return result.substring(0, result.lastIndexOf(","));
	}
	
	*//**
	 * 初始化一级分类信息，以逗号分隔
	 * @return
	 *//*
	public String initTagUpperId() {
		String result = "";
		for(int i=0;i<tags.size();i++) {
			if(!result.contains(tags.get(i).getUpperId()))
				result +=tags.get(i).getUpperId()+",";
		}
		return result.substring(0, result.lastIndexOf(","));
	}
	
	@Override
	public void onClick(View v) {
		Intent intent =null;
		switch(v.getId()) {
		case R.id.title_back:
			this.finish();
			break;
		case R.id.interest_tag_choose:
			intent = new Intent(this,TagChooseActivity.class);
			intent.putExtra("resid", R.xml.interestwall_class_store);
			intent.putParcelableArrayListExtra("tags", (ArrayList<? extends Parcelable>) tags);
			this.startActivityForResult(intent, TOPIC_TAG);
			break;
		case R.id.title_right:
			queryTopicData();
			break;
		}
	}
	
	*//**
	 * 根据修改刷新实体内的数据
	 *//*
	public void refreshEntity() {
		entity.setInfos(tags);
		entity.setPicdesc(groupDesc.getText()+"");
		entity.setPicname(groupName.getText()+"");
	}
	
	public String getReleaseSystemTag() {
		if(releaseSystemMessage.isChecked())
		return "1";
		else return "0";
	}
	
	private void queryTopicData() {
		refreshEntity();//刷新数据后传入http请求方法 更新到服务器
		HttpRestClient.doHttpUpdateInterestGroup(entity.getPicId(), entity.getPicname(), entity.getPicdesc(), initTagInfoLayId(), initTagUpperId(), SmartFoxClient.getLoginUserId(), "Y",  getReleaseSystemTag(), new AsyncHttpResponseHandler() {
			
			private LodingFragmentDialog showLodingDialog;
			@Override
			public void onSuccess(int statusCode, String response) {
				super.onSuccess(statusCode, response);
				if("Y".equals(response.toString())) {
					ToastUtil.showShort(getApplicationContext(), "修改成功");
					InterestReleaseTopic.this.finish();
				} else {
					 onFailure(null);
				}
			}
			@Override
			public void onFailure(Throwable error) {
				super.onFailure(error);
				ToastUtil.showBasicShortToast(getApplicationContext(), "修改失败");
			}
			@Override
			public void onStart() {
				super.onStart();
				showLodingDialog = LodingFragmentDialog.showLodingDialog(manager, 	getResources());
			}
			@Override
			public void onFinish() {
				super.onFinish();
				showLodingDialog.dismissAllowingStateLoss();
			}
		});
	}
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if(resultCode!=RESULT_OK) return;
		//标签实体
		tags.clear();
		tags.addAll((ArrayList<? extends TagEntity>) data.getParcelableArrayListExtra("tags"));
		tagDesc.setText(initTagText());
	}
	
}
*/